Get a Quote for a Token Pair
POST/swap/quote
Get a Quote for a Token Pair
Request
Query Parameters
apiKey stringrequired
(Required) Your Public API key
Example: {{publicKey}}
- application/json
Body
currencyIn string
currencyOut string
amountIn string
Responses
- 201
Created
- application/json
- Schema
- Example (from schema)
- example-0
- example-1
Schema
object
{}
Successful Response
{
"data": {
"info": {
"inputAmount": "1000",
"outputAmount": "2.0988",
"route": [
"G$",
"WFUSE"
],
"inputToken": "G$",
"outputToken": "WFUSE",
"executionPrice": "0.0020988",
"nextMidPrice": "0.00210509",
"priceImpact": "0.30144"
},
"trade": {
"route": {
"pairs": [
{
"liquidityToken": {
"decimals": 18,
"symbol": "VLP",
"name": "Voltage LP Token",
"chainId": 122,
"address": "0xa02ed9Fe9e3351FE2cd1F588B23973C1542dCbCC"
},
"tokenAmounts": [
{
"numerator": [
935045727,
778394003,
126296
],
"denominator": [
660865024,
931322574
],
"currency": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
},
"token": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
}
},
{
"numerator": [
474411765,
6
],
"denominator": [
100
],
"currency": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
"token": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
}
}
]
}
],
"path": [
{
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
{
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
}
],
"midPrice": {
"numerator": [
935045727,
778394003,
126296
],
"denominator": [
474411765,
6
],
"baseCurrency": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
"quoteCurrency": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
},
"scalar": {
"numerator": [
100
],
"denominator": [
660865024,
931322574
]
}
},
"input": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
"output": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
}
},
"tradeType": 0,
"inputAmount": {
"numerator": [
100000
],
"denominator": [
100
],
"currency": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
"token": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
}
},
"outputAmount": {
"numerator": [
847411068,
880920317,
1
],
"denominator": [
660865024,
931322574
],
"currency": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
},
"token": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
}
},
"executionPrice": {
"numerator": [
847411068,
880920317,
1
],
"denominator": [
100000
],
"baseCurrency": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
"quoteCurrency": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
},
"scalar": {
"numerator": [
100
],
"denominator": [
660865024,
931322574
]
}
},
"nextMidPrice": {
"numerator": [
87634659,
971215510,
126294
],
"denominator": [
474511765,
6
],
"baseCurrency": {
"decimals": 2,
"symbol": "G$",
"name": "GoodDollar",
"chainId": 122,
"address": "0x495d133B938596C9984d462F007B676bDc57eCEC"
},
"quoteCurrency": {
"decimals": 18,
"symbol": "WFUSE",
"name": "Wrapped Fuse",
"chainId": 122,
"address": "0x0BE9e53fd7EDaC9F859882AfdDa116645287C629"
},
"scalar": {
"numerator": [
100
],
"denominator": [
660865024,
931322574
]
}
},
"priceImpact": {
"numerator": [
692048708,
219972572,
411550067,
245243790
],
"denominator": [
413848800,
1032735213,
633750127,
827571239,
75
]
}
}
}
}
Error Response
{
"error": {
"code": 1,
"message": "Pool is out of liquidity"
}
}
Loading...